#ifndef FLOATCOMPARE_HPP
#define FLOATCOMPARE_HPP

extern float EPSILON
extern float MAX_REL_ERR
extern unsigned int MAX_ULPS

//bad version (epsilon is not guaranteed to be appropriate for the size of the numbers involved).
//better than == only in the case that epsilon is a proper size relative to lhs & rhs
bool fpCompareAbsError(const float lhs, const float rhs, const float epsilon = EPSILON);
//better version (margin of error is percentage-based) - still not best.
//doesn't play nice with extremely low values.
bool fpCompareRelError(const float lhs, const float rhs, const float max_relative_err = MAX_REL_ERR);
//checks for float proximity by Units in the Last Place (ULPs), using integer typecasting trick
bool fpCompareULPs(const float lhs, const float rhs, const unsigned int MAX_ULPS);
//hybrid - considered equal if any of the above are equal
bool fpCompareCombo(const float lhs, const float rhs,
  const float max_relative_err = MAX_REL_ERR, const float max_absolute_err = EPSILON,
  const unsigned int max_ulps = MAX_ULPS);


#endif
